public class Second {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入：");
        String str=sc.nextLine();
        String regex="[1-9][0-9]{0,9}";
        boolean matches= str.matches(regex);
        if(!matches){
            System.out.println("不符合规范重新输入");
        }else{
            int sum=0;
            for(int i=0;i<str.length();i++){
                char c=str.charAt(i);
                int z=c-'0';
                for(int k=0;k<str.length()-1-i;k++){
                    z=z*10;
                }
                sum=sum+z;
            }
            System.out.println(sum);
        }
    }
}
